<?php
/*
  This file is an independent PHP, so we must hook into WP

  If the path of your wp-content directory is not the default location,
  than you must adjust the "require_once" path

*/
require_once "./../../../../wp-load.php";


// our Maintenance folder inside the plugin's folder
$theUrl = WP_PLUGIN_URL . '/many-tips-together/maintenance/';


// custom images
$stripes = $theUrl.'pattern.png';
$logo = $theUrl.'glow.png';
$logoGreen = $theUrl.'logo-green.png';
$bgGreen = $theUrl.'bg.jpg';


// H1
$siteName = get_bloginfo('name');


// get plugin options
$adminOptionsName = "ManyTipsTogether";
$devOptions = get_option($adminOptionsName);


// default text or plugin options
$line1Default = __('Site in maintenance', 'mtt');
$line1Text = $devOptions['maintenance_mode_line1'];//($devOptions['maintenance_mode_line1'] == "") ? $line1Default : $devOptions['maintenance_mode_line1'];

$line2Default = __('We\'ll be back soon, thanks for your patience', 'mtt');
$line2Text = $devOptions['maintenance_mode_line2'];//($devOptions['maintenance_mode_line2'] == "") ? $line2Default : $devOptions['maintenance_mode_line2'];

// CSS of this file
echo <<<CSS
<style type="text/css">
	*{padding:0;margin:0}
	html{background:url('$stripes') repeat}
	body{border:0;width:900px;height:600px;background:url('$bgGreen')  no-repeat;font-family:'Myriad Pro',Arial,Helvetica,sans-serif;}
	#logo.blank{background:url('$logo') no-repeat;text-indent:0}
	#logo{height:397px;margin-bottom:-200px}
	#when,.textwidget{font-size:18px;text-align:center;margin-top:45px;}
	#wrapper{width:467px;margin:80px auto}
	h1{padding-top:180px;color:#fff;font-size:36px;font-weight:bold;text-align:center;white-space:nowrap;text-shadow: 0.1em 0.1em 0.2em black}
	h2{color:#fff;font-size:12px;letter-spacing: 0.1em;font-weight:bold;text-align:center;text-shadow: 0.1em 0.1em 1.2em black;}
	#when,.textwidget{color:#65a70e; font-size:1.2em;}
</style>
CSS;

// html of this file
echo <<<EOT
<div id="wrapper">
<div id="logo" class="blank">
<h1>{$siteName}</h1>
</div>
<div id="when">
{$line1Text}
<h2><a href="http://{$line2Text}">{$line2Text}</a></h2>
</div>

</div>
EOT;


?>